<template>
	<view class="mine">
		<view class="content">
			<view class="item" @tap="toPage('/pages/UserInfo/index')">
				<view class="left">
					<u-icon name="../../static/ico/icon/userinfo_icon.png" size="22"></u-icon>
					<view class="title">个人信息</view>
				</view>
				<u-icon name="arrow-right" color="#BBBBBB"></u-icon>
			</view>
			<view class="item" @tap="topages()">
				<view class="left">
					<u-icon name="../../static/ico/icon/account_icon.png" size="22"></u-icon>
					<view class="title">收款账号</view>
				</view>
				<u-icon name="arrow-right" color="#BBBBBB"></u-icon>
			</view>
			<view class="item" @tap="toPage('/pages/save/index')">
				<view class="left">
					<u-icon name="../../static/ico/icon/SecurityCenter_icon.png" size="22"></u-icon>
					<view class="title">安全中心</view>
				</view>
				<u-icon name="arrow-right" color="#BBBBBB"></u-icon>
			</view>
			<!-- @tap="toPage('/subpage/Privacy/index')" -->
			<view class="item" @tap="toPage('/subpage/Privacy/index')">
				<view class="left">
					<u-icon name="../../static/ico/icon/lockSetting_icon.png" size="22"></u-icon>
					<view class="title">隐私设置</view>
				</view>
				<u-icon name="arrow-right" color="#BBBBBB"></u-icon>
			</view>
			<view class="item" @tap="toPage('/pages/about/index')">
				<view class="left">
					<u-icon name="../../static/ico/icon/about_icon.png" size="22"></u-icon>
					<view class="title">关于我们</view>
				</view>
				<u-icon name="arrow-right" color="#BBBBBB"></u-icon>
			</view>
			<view class="item" @tap="toPage('/pages/about/discuss')">
				<view class="left">
					<u-icon name="../../static/ico/icon/agreement_icon.png" size="22"></u-icon>
					<view class="title">协议</view>
				</view>
				<u-icon name="arrow-right" color="#BBBBBB"></u-icon>
			</view>
			<!-- <view class="item" @tap="toPage('/pages/help/index')">
				<view class="left">
					<view class="title">帮助中心</view>
				</view>
				<u-icon name="arrow-right" color="#BBBBBB"></u-icon>
			</view> -->

			<!--<view class="item" @tap="toPage('/pages/UserInfo/index')">
				<view class="left">
					
					<view class="title">个人信息</view>
				</view>
				<u-icon name="arrow-right" color="#FFFFFF"></u-icon>
			</view>
			<view class="item" @tap="toPage('/pages/Pact/index?type=user_agreement')">
				<view class="left">
					
					<view class="title">用户协议</view>
				</view>
				<u-icon name="arrow-right" color="#FFFFFF"></u-icon>
			</view>
			<view class="item" @tap="toPage('/pages/Pact/index?type=privacy_agreement')">
				<view class="left">
					
					<view class="title">隐私协议</view>
				</view>
				<u-icon name="arrow-right" color="#FFFFFF"></u-icon>
			</view> -->
			<view class="item" @click="easterEgg">
				<view class="left">
					<u-icon name="../../static/ico/icon/edition_icon.png" size="22"></u-icon>
					<view class="title">当前版本</view>
				</view>
				<view>{{version}}</view>
			</view>
		</view>
		<view class="quit" @tap="quit">退出登录</view>
	</view>
</template>

<script>
	import {
		mixin
	} from '@/Mixins/mixin.js'
	import {
		mapState,
		mapMutations
	} from 'vuex'
	export default {
		mixins: [mixin],
		data() {
			return {
				version: '1.0.0',
				isFlag: false,
				count: 0
			}
		},
		onReady() {

		},
		onLoad() {
			//#ifdef APP-PLUS
			plus.runtime.getProperty(plus.runtime.appid, inf => {
				// console.log('inf-----', inf);
				this.version = inf.version;
			});
			//#endif
		},
		computed: {
			...mapState(['userInfo']),
		},
		methods: {
			easterEgg () {
				this.isFlag = true
				this.count++
				let time
				if (this.isFlag && this.count >= 10) {
					// this.$u.toast('您已进入开发者模式')
					uni.navigateTo({
						url: '/pages/Site/egg'
					})
				}
				time = setTimeout(() => {
					this.isFlag = false
					this.count = 0
					clearTimeout(time)
				}, 1500)
			},
			topages() {
				this.userInfo.bank_account ?
					this.toPage('/pages/wallet/bankList') :
					this.toPage('/pages/wallet/addBank')
			},
			quit() {
				uni.showModal({
					title: '提示',
					content: '是否退出当前账号',
					success: (res) => {
						if (res.confirm) {
							this.$store.commit('ChangeUserInfo', {});
							this.$store.commit('ChangeToken', '');
							// #ifndef H5
							this.toPage('/pages/Index/index')
							// #endif
							// #ifdef H5
							// window.location.href = "/H5/"
							this.toPage('/pages/Index/index')
							// #endif
						} else if (res.cancel) {

						}
					}
				});

			}
		}
	}
</script>

<style lang="scss" scoped>
	.mine {
		// min-height: 100vh;
		padding: 30rpx;
		box-sizing: border-box;
		background-color: $nft-bg-color;
		border-top: #F5F5F5 2rpx solid;

		.content {

			// background: #333333;
			// border-radius: 28rpx;
			// padding: 0 26rpx 0 34rpx;
			.item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-size: 28rpx;
				font-weight: 600;
				color: #131415;
				padding: 34rpx 0 34rpx 0;
				// border-bottom: 1px solid #F5F5F5;

				&:last-child {
					// border-bottom: 0;
				}

				.left {
					display: flex;
					align-items: center;

					image {
						width: 32rpx;
						height: 36rpx;
						margin-right: 44rpx;
					}
					.title {
						margin-left: 20rpx;
					}
				}
			}
		}

		.quit {
			width: calc(100% - 60rpx);
			height: 90rpx;
			background: #468EFF;
			border-radius: 4rpx;
			font-size: 28rpx;
			color: #FFF;
			line-height: 90rpx;
			text-align: center;
			position: fixed;
			bottom: 100rpx;
		}
	}
</style>
